nofail SSH Mounting in fstab

The following /etc/fstab entry is placed on your client machine, connecting you to your remote machine using SSH keys:

Note that sshfs will have to be installed on your client in order for this to work. This can be done through your distro's package manager.

sshfs#{REMOTE}@{IP_ADDRESS}:/mnt/{REMOTE_DIR} /mnt/{CLIENT_DIR} fuse ServerAliveInterval=1,reconnect,port={PORT},defaults,_netdev,IdentityFile=/home/{CLIENT}/.ssh/id_rsa,allow_other,nofail 0 0

The port option can be ommited if the default SSH port is used.

The nofail option is important. If you client can't connect for whatever reason, your entire system won't halt due to a boot failure.

reconnect and ServerAliveInterval=1 are also important. These are used to ensure your machine doesn't halt in case the server/remote disconnects while the connection is in use.


Check out these notes...
2022-08-22 00:05:08 WSL 2 Setup
2024-01-06 01:12:15 Basic Windows Security Tips
2024-02-16 20:21:36 Meta Quest 3 Shortcuts
2023-08-08 08:50:58 nofail SSH Mounting in fstab
2023-09-10 13:07:37 Accessing QEMU/KVM From An Android Device Over SSH/SPICE Server